<?php

  require_once "JooS/Server/Stream/Abstract.php";
  require_once "JooS/File/Xsl.php";

  final class JooS_Server_Stream_Xsl extends JooS_Server_Stream_Abstract {
    const STREAM_PROTOCOL = "xsl";

    public static function stream_register() {
      parent::_stream_register(self::STREAM_PROTOCOL, __CLASS__);
    }

    public function stream_get_content($path) {
      $url = parse_url($path);

      $xslFilename = $url["host"];
      if (isset($url["path"]))
        $xslFilename .= $url["path"];

      $xslFile = new JooS_File_Xsl($xslFilename);
      return $xslFile->getDocument()->saveXML();
    }
  }

?>